home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / QuickTime VR / MacOS / QuickDraw™ 3D 1.0.6F4 SDK / Development / RAVE DDK 1.0.6 GM for MacOS / Projects / Test Code / TinselTest.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-30  |  3.1 KB  |  158 lines  |  [TEXT/MPCC]

  1. /******************************************************************************
  2.  **                                                                             **
  3.  **     Module:        TinselTest.h                                             **
  4.  **                                                                          **
  5.  **     Purpose:     Include file for Tinsel Town test app                     **
  6.  **                                                                          **
  7.  **     Author:        Mike W. Kelley                                             **
  8.  **                                                                             **
  9.  **                    2/3/95    Revised for 0.9 SDK release                         **
  10.  **                                                                          **
  11.  **     Copyright (C) 1994-95 Apple Computer, Inc.  All rights reserved.     **
  12.  **                                                                          **
  13.  *****************************************************************************/
  14.  
  15. #define kTinselWindows                2
  16. #define kDeviceWindowBorder            20
  17. #define kTinselMaxWindowSize        350
  18. #define kWindowClipBoundary            20
  19. #define kClipRoundRect                20
  20. #define kTextureSizeNBits            8
  21. #define kTextureSize                (1<<kTextureSizeNBits)
  22.  
  23. /* kStyle... are constants that switch between the available styles */
  24. #define kStyleSingleBuffered        0
  25. #define kStyleDoubleBuffered        1
  26. #define kStyleSingleBufferedClip    2
  27. #define kStyleDoubleBufferedClip    3
  28.  
  29. #define kMaxStyle                    kStyleDoubleBufferedClip
  30.  
  31. /* kTest... are constants that switch between the available tests */
  32. #define kTestPoints                    0
  33. #define kTestLines                    1
  34. #define kTestTriGouraud                2
  35. #define kTestTriTexture                3
  36.  
  37. #define kMaxTest                    kTestTriTexture
  38.  
  39. /* kN... set the number of primitives drawn in the kTinsel... tests */
  40. /* kNFlush sets how many times flush is called per frame */
  41. #define kNPoints                    10000
  42. #define kNLines                        1000
  43. #define kNTris                        100
  44. #define kNFlushes                    5
  45.  
  46. /*
  47.  * Global variables.
  48.  */
  49.  
  50. extern    long            gWindowWidth, gWindowHeight;
  51. extern    TQAEngine        *gEngine [kTinselWindows];
  52. extern    TQADrawContext    *gDrawContext [kTinselWindows];
  53. extern    TQATexture        *gTexture [kTinselWindows];
  54.  
  55. /*
  56.  * Handy datatypes.
  57.  */
  58.  
  59. typedef struct TexturePixel
  60. {
  61.     unsigned char        a;        /* D31:24 */
  62.     unsigned char        r;        /* D23:16 */
  63.     unsigned char        g;        /* D15:8 */
  64.     unsigned char        b;        /* D7:0 */
  65. } TexturePixel;
  66.  
  67. /*
  68.  * Function prototypes.
  69.  */
  70.  
  71. void InitToolbox (void);
  72.  
  73. Boolean CreateTestWindows (
  74.     long            maxWidth,
  75.     long            maxHeight);
  76.  
  77. Boolean CreateWindowClip (
  78.     void);
  79.  
  80. void ClearWindows (
  81.     void);
  82.  
  83. TQATexture *CreateMipMapTexture (
  84.     TQAEngine        *engine,
  85.     TexturePixel    *pixmap,
  86.     long            rowBytes,
  87.     long            widthNBits,
  88.     long            heightNBits);
  89.  
  90. void TinselError (
  91.     const char        *message);
  92.  
  93. /*
  94.  * Test functions. These all operate on all the open test windows.
  95.  */
  96.  
  97. void TestRandomVGouraud (
  98.     TQAVGouraud            *v);
  99.  
  100. void TestRandomVTexture (
  101.     TQAVTexture        *v);
  102.  
  103. Boolean TestDrawContextNew (
  104.     unsigned long    flags,
  105.     Boolean            do2DClipping);
  106.  
  107. void TestDrawContextDelete (
  108.     void);
  109.  
  110. Boolean TestTextureNew (
  111.     void);
  112.  
  113. void TestRenderStart (
  114.     void);
  115.  
  116. void TestRenderEnd (
  117.     void);
  118.  
  119. void TestSetStateTexture (
  120.     void);
  121.  
  122. void TestFlush (
  123.     void);
  124.  
  125. void TestDrawPoint (
  126.     const TQAVGouraud    *v);
  127.  
  128. void TestDrawLine (
  129.     const TQAVGouraud    *v0,
  130.     const TQAVGouraud    *v1);
  131.  
  132. void TestDrawTriGouraud (
  133.     const TQAVGouraud    *v0,
  134.     const TQAVGouraud    *v1,
  135.     const TQAVGouraud    *v2,
  136.     unsigned long        flags);
  137.  
  138. void TestDrawTriTexture (
  139.     const TQAVTexture    *v0,
  140.     const TQAVTexture    *v1,
  141.     const TQAVTexture    *v2,
  142.     unsigned long        flags);
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.